package com.javafactroy.kunlong;

import app.dto.JsonResult;
import com.javafactroy.kunlong.client.feign.factroy.ClientServiceFactroy;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.event.annotation.AfterTestClass;
import org.springframework.test.context.event.annotation.BeforeTestClass;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.io.IOException;
import java.util.function.Function;


/**
 * @author leijmdas
 * @date 2021/9/14
 * @ddescription:
 * @company:
 */


@SpringBootTest(classes = {OpenFeignApp.class}, webEnvironment = SpringBootTest.WebEnvironment.NONE)
@SpringBootApplication
@ExtendWith(SpringExtension.class)
@Slf4j
public class TestOpenFeign {

    @Autowired
    ClientServiceFactroy clientServiceFactroy;

    @BeforeTestClass
    public void setupClass() {

    }

    @AfterTestClass
    public void tearDownClass() {

    }

    @BeforeEach
    public void setUp() {
        log.info("setUp");
    }

    @AfterEach
    public void tearDown() {
        log.info("tearDown");

    }

    @Test
    public void Test001_manager() throws IOException {
        log.info("Test001_manager");

    }

    @Test
    public void Test002_clientLocal() {
        JsonResult jsonResult = clientServiceFactroy.find().send();
        log.info("jr={}", jsonResult.toString());
        Function<Integer,Integer> a = i->i;
        log.info("{}",a.apply(111));

    }

}
